<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>css样式</title>
  <script src="./js/jquery.js"></script>
  <style>
    * {
      padding: 0;
      margin: 0;
    }
  </style>
</head>
<!-- 
  逐个设置
    css("width","100px");
    css("height","100px");
  链式设置，注意点:链式大于三步建议分开
    css("width","100px").css("height","100px");
  批量设置
    css({
      width: "100px",
      height: "200px",
      background-color: "red"
    });
  获取css样式
    .css("width");
 -->

<body>
  <div class="cls1"></div>
  <div class="cls2"></div>
</body>
<script>
  "use strict";
  $(function () {
    $(".cls1").css("width", "100px").css("height", "50px").css("background-color", "pink");
    $(".cls2").css({
      "width": "100px",
      "height": "200px",
      "background-color": "blue"
    });
    let i = $(".cls2").css("background-color");
    let j = $(".cls2").css("backgroundColor");
    let k = $(".cls2").css("background");
    console.log(i);
    console.log(j);
    console.log(k);
  });
</script>

</html>